// EPropertyDateTime.h: interface for the EPropertyDateTime class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EPROPERTYDATETIME_H)
#define AFX_EPROPERTYDATETIME_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <memory>
#include "EIconTextButtonProperty.h"

class EPropertyDateTimeWindow;
class PROPERTY_VIEW_LIB_API EPropertyDateTime final : public EIconTextButtonProperty
{
public:
    EPropertyDateTime(IPropertyHost *pHost, const std::wstring &sName, time_t *pProperty, bool bEnabled);
    virtual ~EPropertyDateTime();

    void OnWindowButtonOk();
    void OnWindowButtonCancel();

protected:
    virtual bool OnCommand(EPropWnd *pParent, WPARAM wParam, LPARAM lParam);
    virtual bool OnPropApply();
    virtual void OnPropClose();
    virtual bool HasButton();
    virtual bool HasEdit();
    virtual std::wstring GetTextValue();

private:
    void ClosePropertyWindow();
    time_t GetPropertyValue();

    std::unique_ptr<EPropertyDateTimeWindow> m_pPropertyWindow;
    EPropWnd *m_pCtrl;
};

#endif // !defined(AFX_EPROPERTYDATETIME_H)
